<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="UTF-8">
    <title>详情</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <script src="https://www.layuicdn.com/layui-v2.5.6/layui.js"></script>

</head>
<body>
    <div th:insert="~{public/publicTop::top}"></div>
    <div  style="width: 70%; margin: auto;">
        <div class="layui-col-md6"> <img th:src="@{'/img/'+${good.getMainimg()}}" style="width: 100%;"></div>
        <div class="layui-col-md6 " style="padding-top: 200px">
            <h1 th:text="${good.getName()}"></h1>
            <h2 style="color: #f25807;" th:text="${good.getPrice()+'元'}"></h2>

            <form action="" class="layui-form" th:action="@{/addShangPin}">
                <input type="hidden" name="id" th:value="${good.getId()}">
                <div class="layui-form-item">
                    <label class="layui-form-label">颜色</label>
                    <div class="layui-input-block">
                        <input th:each="color:${colors}" type="radio" name="color" th:value="${color}" th:title="${color}">
                    </div>
                </div>

                <br>
                <input style="background-color: #f25807;text-align: center; margin: auto" class="layui-btn" type="submit" th:disabled="${good.getGstate()==1? 'true':'false'}" value="加入购物车">
            </form>
        </div>
    </div>
    <div>
        <img src="">
    </div>
</body>
<script >
    layui.use('form', function(){
        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
        form.render();
    });
</script>
</html>